<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>您有以下备注需要回复</span>
        <!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button> -->
      </div>
      <template>
        <el-table :data="tableData" style="width: 100%" border stripe>
          <el-table-column prop="id" label="客户id" width="200"></el-table-column>
          <el-table-column prop="name" label="客户姓名" width="200"></el-table-column>
          <el-table-column prop="phone" label="客户手机号" width="250"></el-table-column>
          <el-table-column label="最后一次备注时间" >
              <template slot-scope="scope">
                {{scope.row.lastNoteTime.time |formatTime}}
              </template>
            </el-table-column>
          <!-- <el-table-column prop="userName" label="备注人" width="180"></el-table-column>
          <el-table-column prop="content" label="内容"></el-table-column> -->
          <el-table-column label="操作" >
              <template slot-scope="scope">
                <el-button @click="Reply(scope.row.id)" type="text">跳转</el-button>
              </template>
            </el-table-column>
        </el-table>
      </template>
    </el-card>
  </div>
</template>

<script>
import { websocketObj } from "../../@/websocket/websocket";
import moment from "moment";
export default {
  data() {
    return {
      wx: "",
      // loading: true,
      tableData: [],
    };
  },
  created() {
   this.tableData =window.sessionStorage.getItem("bz")
   console.log(this.tableData)
  },
  methods:{
    Reply(id) {
        this.$router.push({ path: `/myCusEdit`, query: { "CusId": id ,"addatbn" :"false" } })
         window.sessionStorage.setItem("CusId", id);
        window.sessionStorage.setItem("addatbn", "false");
    }
  },
  filters: {
      formatTime(value) {
      return moment(value).format("YY-MM-DD HH:mm:ss");
    },
  },
  activated() {
    this.tableData = JSON.parse(window.sessionStorage.getItem("bz"))
  },
  beforeDestroy() {
    wx.close();
  },
};
</script>

<style scoped>
span {
  font-size: 18px;
}
</style>